/*
*需求：提示用户输入年月日信息，判断这一天是这一年中的第几天并打印
*/


import java.util.Scanner;

public class HomeWork1{

	public static void main(String[] args) {
		
		//提示用户输入日期
		System.out.print("请输入年月日（YYYY-MM-DD）：");
		Scanner sc = new Scanner(System.in);
		String myDate = sc.next();

		//处理用户输入的字符串，转化为年月日
		String[] str = myDate.split("-");
		int myYear   = Integer.parseInt(str[0]);
		int myMonth  = Integer.parseInt(str[1]);
		int myDay    = Integer.parseInt(str[2]);

		// System.out.println("myYear = " + myYear);
		// System.out.println("myMonth = " + myMonth);
		// System.out.println("myDay = " + myDay);

		int ferDays = 28;     //2月默认天数
		if ((myYear%4==0&&myYear%100!=0)||myYear%400==0) {   //平年还是闰年
			if (myMonth==2) {
				ferDays = 29;
			}
		}
		int days = myDay;         //是本年的第几天

		//利用switch穿透原理，计算天数
		switch (myMonth-1) {
			case 11:
				days +=30;
			case 10:
				days +=31;
			case 9:
				days +=30;
			case 8:
				days +=31;
			case 7:
				days +=31;
			case 6:
				days +=30;
			case 5:
				days +=31;
			case 4:
				days +=30;
			case 3:
				days +=31;
			case 2:
				days +=ferDays;
			case 1:
				days +=31;
				System.out.println("今天是" + myYear + "年的第" + days + "天");
				break;
			default:
				//如输入日期格式不正确，提示请输入正确日期
				System.out.println("请输入正确的日期格式！！");break;
		}
		
	}
}